/*
 * Created by JFormDesigner on Mon Jul 29 00:17:26 EDT 2013
 */

package MaintMenu.VenPricingUpdTBLN;

import MaintMenu.VendorCostPreProcess;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.GroupLayout;
import javax.swing.LayoutStyle;

/**
 * @author jason Chi
 */
public class VendorPricingUpdateTBLN extends JPanel {
    public VendorPricingUpdateTBLN() {
        initComponents();
    }

    private void buttonAPActionPerformed(ActionEvent e) {
        APtbl ap= new APtbl(0);
        JOptionPane.showMessageDialog(null, "Execute Complete");
    }

    private void buttonYCCActionPerformed(ActionEvent e) {
        YCCtbl ycc= new YCCtbl(0);
        JOptionPane.showMessageDialog(null, "Execute Complete");
    }

    private void buttonTESTActionPerformed(ActionEvent e) {
        testTBL t1 = new testTBL();
        JOptionPane.showMessageDialog(null,"Execute Complete");

    }

    private void tygtwActionPerformed(ActionEvent e) {
        TYGtwtbl tyGtw = new TYGtwtbl(0);
        TYGtwtbl tyGtw1 = new TYGtwtbl(1);
        JOptionPane.showMessageDialog(null,"Execute Complete");
    }

    private void tygtxActionPerformed(ActionEvent e) {
        TYGtxtbl tyGtx = new TYGtxtbl(0);
        TYGtxtbl tyGtx1 = new TYGtxtbl(1);
        JOptionPane.showMessageDialog(null,"Execute Complete");
    }

    private void generaActionPerformed(ActionEvent e) {
        GENERAtbl gen = new GENERAtbl(0);
        JOptionPane.showMessageDialog(null,"Execute Complete");
    }

    private void depoActionPerformed(ActionEvent e) {
        DEPOtbl depo1 = new DEPOtbl(0);
        JOptionPane.showMessageDialog(null,"Execute Complete");
    }

    private void dnkworkActionPerformed(ActionEvent e) {
        Trn6Category trn6Category = new Trn6Category();
        JOptionPane.showMessageDialog(null,"Execute Complete");
    }

    private void updAllActionPerformed(ActionEvent e) {

        //*
        //update Vendor Cost sheet receives from mail. _costdepo1-4 adds CAPA and PARTSLINK field and isolates.
        VendorCostPreProcess vc = new VendorCostPreProcess("DP",4);
        //*

        APtbl ap= new APtbl(0);
        System.out.println("\nAP Complete\n");
        YCCtbl ycc= new YCCtbl(0);
        System.out.println("\nYCC Complete\n");
        TYGtwtbl tyGtw = new TYGtwtbl(0);
        TYGtwtbl tyGtw1 = new TYGtwtbl(1);
        System.out.println("\nTW Complete\n");
        TYGtxtbl tyGtx = new TYGtxtbl(0);
        TYGtxtbl tyGtx1 = new TYGtxtbl(1);
        System.out.println("\nTX Complete\n");
        GENERAtbl gen = new GENERAtbl(1);
        System.out.println("\nGN Complete\n");
        DEPOtbl depo1 = new DEPOtbl(0);
        System.out.println("\nDP Complete\n");
        JOptionPane.showMessageDialog(null,"Execute Complete");

    }

    private void vendorFindByPLActionPerformed(ActionEvent e) {
//        FindItemByVendorSheetPL findItemByVendorSheetPL = new FindItemByVendorSheetPL(vendToFind.getText(),partlinkToFind.getText(),Integer.getInteger(sheetToFind.getText()));
    }

    private void ManualSQLStatementActionPerformed(ActionEvent e) {
        // TODO add your code here
    }

    private void button1ActionPerformed(ActionEvent e) {
        // TODO add your code here
    }

    private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        // Generated using JFormDesigner Evaluation license - jason Chi
        label1 = new JLabel();
        buttonAP = new JButton();
        label2 = new JLabel();
        buttonYCC = new JButton();
        label3 = new JLabel();
        ManualSQLStatement = new JButton();
        tygtw = new JButton();
        tygtx = new JButton();
        genera = new JButton();
        depo = new JButton();
        updAll = new JButton();
        label4 = new JLabel();
        label5 = new JLabel();
        label6 = new JLabel();
        label7 = new JLabel();
        masTocatUpd = new JButton();
        dnkWork = new JButton();
        partlinkToFind = new JTextField();
        vendorFindByPL = new JButton();
        vendToFind = new JTextField();
        sheetToFind = new JTextField();

        //======== this ========
        setPreferredSize(new Dimension(400, 900));

        // JFormDesigner evaluation mark
        setBorder(new javax.swing.border.CompoundBorder(
            new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
                "JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
                javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
                java.awt.Color.red), getBorder())); addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});


        //---- label1 ----
        label1.setText("Vendor Pricing Update to TBL??N");
        label1.setForeground(Color.blue);
        label1.setFont(new Font("sansserif", Font.BOLD, 24));

        //---- buttonAP ----
        buttonAP.setText("AP (GORDON)");
        buttonAP.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                buttonAPActionPerformed(e);
            }
        });

        //---- label2 ----
        label2.setText("BC,HF,OT");

        //---- buttonYCC ----
        buttonYCC.setText("YCC (PROTEC)");
        buttonYCC.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                buttonYCCActionPerformed(e);
            }
        });

        //---- label3 ----
        label3.setText("BC,OT");

        //---- ManualSQLStatement ----
        ManualSQLStatement.setText("Manual SQL Statement");
        ManualSQLStatement.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                ManualSQLStatementActionPerformed(e);
            }
        });

        //---- tygtw ----
        tygtw.setText("TYG Taiwan");
        tygtw.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                tygtwActionPerformed(e);
            }
        });

        //---- tygtx ----
        tygtx.setText("TYG Texas");
        tygtx.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                tygtxActionPerformed(e);
            }
        });

        //---- genera ----
        genera.setText("GENERA (TYC)");
        genera.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                generaActionPerformed(e);
            }
        });

        //---- depo ----
        depo.setText("DEPO (MAXZONE)");
        depo.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                depoActionPerformed(e);
            }
        });

        //---- updAll ----
        updAll.setText("UPDATE ALL VENDORS");
        updAll.setToolTipText("Copy MAST11 to MAST1 and updates 6 Cats");
        updAll.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                updAllActionPerformed(e);
            }
        });

        //---- label4 ----
        label4.setText("BC, HF,MR,CL,OT");

        //---- label5 ----
        label5.setText("BC, CL");

        //---- label6 ----
        label6.setText("MR,CL,LT");

        //---- label7 ----
        label7.setText("MR,CL,LT");

        //---- masTocatUpd ----
        masTocatUpd.setText("Transfer Master files to CATs ");
        masTocatUpd.setToolTipText("COPY from Mast11 to Mast1, Transfer to 6 Cats, Price update form TBLINVENTORY");
        masTocatUpd.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                dnkworkActionPerformed(e);
            }
        });

        //---- dnkWork ----
        dnkWork.setText("DNKWORK Complete");
        dnkWork.setToolTipText("COPY from Mast11 to Mast1 only. Very long process approx 1 hr)");
        dnkWork.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                button1ActionPerformed(e);
            }
        });

        //---- partlinkToFind ----
        partlinkToFind.setText("PL");

        //---- vendorFindByPL ----
        vendorFindByPL.setText("Find Vendor(ng)");
        vendorFindByPL.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                vendorFindByPLActionPerformed(e);
            }
        });

        //---- vendToFind ----
        vendToFind.setText("TW");

        //---- sheetToFind ----
        sheetToFind.setText("1");

        GroupLayout layout = new GroupLayout(this);
        setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup()
                .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addGap(0, 0, Short.MAX_VALUE)
                    .addComponent(label1)
                    .addGap(62, 62, 62))
                .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                        .addComponent(updAll, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(vendToFind, GroupLayout.PREFERRED_SIZE, 47, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(partlinkToFind, GroupLayout.PREFERRED_SIZE, 94, GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(sheetToFind, GroupLayout.PREFERRED_SIZE, 45, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(vendorFindByPL)))
                    .addGap(38, 38, 38))
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                        .addComponent(ManualSQLStatement)
                        .addGroup(layout.createParallelGroup()
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(buttonAP, GroupLayout.PREFERRED_SIZE, 182, GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(label2, GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE))
                            .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING, false)
                                .addGroup(layout.createSequentialGroup()
                                    .addComponent(depo, GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(label7, GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE))
                                .addGroup(layout.createSequentialGroup()
                                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
                                        .addComponent(tygtw, GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
                                        .addComponent(buttonYCC, GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
                                        .addComponent(tygtx, GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE)
                                        .addComponent(genera, GroupLayout.DEFAULT_SIZE, 182, Short.MAX_VALUE))
                                    .addGap(12, 12, 12)
                                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.TRAILING)
                                        .addComponent(label3, GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE)
                                        .addComponent(label4, GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE)
                                        .addComponent(label5, GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE)
                                        .addComponent(label6, GroupLayout.PREFERRED_SIZE, 123, GroupLayout.PREFERRED_SIZE))))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(64, 64, 64)
                                .addComponent(dnkWork)
                                .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(masTocatUpd))))
                    .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup()
                .addGroup(layout.createSequentialGroup()
                    .addComponent(label1)
                    .addGap(15, 15, 15)
                    .addGroup(layout.createParallelGroup()
                        .addComponent(label2, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
                        .addComponent(buttonAP))
                    .addGap(5, 5, 5)
                    .addGroup(layout.createParallelGroup()
                        .addComponent(label3, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
                        .addComponent(buttonYCC))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup()
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(tygtw)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(tygtx)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(genera)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(depo))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(label4, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(label5, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(label6, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(label7, GroupLayout.PREFERRED_SIZE, 28, GroupLayout.PREFERRED_SIZE)))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(updAll)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(dnkWork)
                        .addComponent(masTocatUpd))
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(ManualSQLStatement)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 85, Short.MAX_VALUE)
                    .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
                        .addComponent(vendorFindByPL)
                        .addComponent(partlinkToFind, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(vendToFind, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
                        .addComponent(sheetToFind, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))
                    .addGap(30, 30, 30))
        );
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }

    // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables
    // Generated using JFormDesigner Evaluation license - jason Chi
    private JLabel label1;
    private JButton buttonAP;
    private JLabel label2;
    private JButton buttonYCC;
    private JLabel label3;
    private JButton ManualSQLStatement;
    private JButton tygtw;
    private JButton tygtx;
    private JButton genera;
    private JButton depo;
    private JButton updAll;
    private JLabel label4;
    private JLabel label5;
    private JLabel label6;
    private JLabel label7;
    private JButton masTocatUpd;
    private JButton dnkWork;
    private JTextField partlinkToFind;
    private JButton vendorFindByPL;
    private JTextField vendToFind;
    private JTextField sheetToFind;
    // JFormDesigner - End of variables declaration  //GEN-END:variables
}
